<?php
 /**
 * SkinTemplate class for Gamux skin
 * @ingroup Skins
 */
class GamuxTemplate extends BaseTemplate {
	/**
	 * Outputs the entire contents of the page
	 */
	public function execute() {
		wfSuppressWarnings();
		$this->html( 'headelement' ); 
?>
<div class="body">
<!-- 头部 -->

<header class="am-topbar am-g am-topbar-inverse">
  <div class="topbar-inner am-u-sm-11 am-u-md-11 am-u-lg-10">
    <div class="am-topbar-brand topbar-brand topbar-logo am-u-lg-2 am-u-md-1 am-u-sm-4">
    <!--以下函数调用网站的名字,链接是首页地址-->
	  <a href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ); ?>">
	  <?php $this->text( 'sitename' ); ?>
	  </a>
	</div>	
    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#doc-topbar-collapse'}">
	  <span class="am-sr-only">导航切换</span> 
	  <span class="am-icon-bars"></span>
	</button>
	<div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
	  <ul class="am-nav am-nav-pills am-topbar-nav">
	    <li id="homepage" class="<?php if($this->data["title"] == "首页"){echo "am-active";} ?>"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ); ?>">首页</a></li>
	    <li id="itempage"><a href="#">项目</a></li>
		<li id="specialpage"><a href="/index.php/special:specialpages">特殊页面</a></li>
	    <li class="am-dropdown" data-am-dropdown>
		  <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
		    关于本站 <span class="am-icon-caret-down"></span>
		  </a>
		  <ul class="am-dropdown-content">
		    <li class="am-dropdown-header">现任站长：Saro</li>
		    <li><a href="#">本站介绍</a></li>
		    <li class="am-active"><a href="#">免责声明</a></li>
		    <li><a href="#">团队人员</a></li>
		    <li class="am-divider"></li>
		    <li><a href="#">联系我们</a></li>
		  </ul>
	    </li>
	  </ul>
	  <form class="am-topbar-form am-topbar-left am-form-inline top-search" role="search" method="get" action="<?php echo $this->data['searchaction']; ?>">
	    <div class="am-form-group">
		  <input type="hidden" value="special:search" name="title">
		  <input type="hidden" value="default" name="profile">
		  <input type="hidden" value="Search" name="fulltext">
		  <input type="search" class="am-form-field am-input-sm" placeholder="search" name="search">
		  

	    </div>
	  </form>
	  <div class="am-topbar-right">
	    <div class="am-dropdown" data-am-dropdown="{boundary: '.am-topbar'}">
		  <button class="am-btn am-btn-secondary am-topbar-btn am-btn-sm am-dropdown-toggle" data-am-dropdown-toggle>其他 <span class="am-icon-caret-down"></span></button>
		  <ul class="am-dropdown-content">
		    <?php if(!$this->data["loggedin"]) { ?>
		    <li><a href="/index.php/special:createaccount">注册</a></li>			
		    <li><a href="<?php echo "http://".$_SERVER['HTTP_HOST']."/index.php/special:passwordreset"; ?>">找回密码</a></li>
			<?php }else{ ?>			
			<li><a href="<?php echo $this->getPersonalTools()["preferences"]["links"]["0"]["href"]; ?>">用户中心</a></li>
			<?php } ?>
		  </ul>
	    </div>
	  </div>
	  <div class="am-topbar-right">
	    <button class="am-btn am-btn-primary am-topbar-btn am-btn-sm">
		  <a href="
		  <?php if($this->data["loggedin"]) { ?>
		    <?php echo $this->getPersonalTools()["logout"]["links"]["0"]["href"]; ?>
			">退出
		  <?php }else { ?>
		    <?php echo "http://localhost/index.php/special:login"; ?>
			">登录
		  <?php } ?>
		  </a>
		</button>
	  </div>
	</div>
  </div>
</header>

<!-- 主要部分 -->
<div class="am-g main">
  <div class="am-u-sm-11 am-u-md-11 am-u-lg-10 main-inner">
    <div class="breadcrumb">
	  <ol class="am-breadcrumb am-breadcrumb-slash">
	    <li><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ); ?>" class="am-icon-home">首页</a></li>
	    <li><?php $this->html( 'title' ); ?></li>
	  </ol>
	  <div class="textactions">
	  <?php $nav = $this->data['content_navigation'];
		//文章编辑框
		foreach($nav as $key => $value){
		  foreach($value as $ke => $val){
			echo "<span class='am-badge am-badge-primary'><a href='".$val["href"]."'>".$val["text"]."</a></span>";
		  }}?>		
	  </div>
	</div>
	<hr data-am-widget="divider" style="" class="am-divider am-divider-dashed" />
	<?php
	if ( $this->data['sitenotice'] ) { ?>
		<div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
	<?php } ?>
	<div class="bodytext">
	  <?php $this->html( 'bodytext' ) ?>
	  <div class="textmeta">
	    <?php if($this->data['isarticle']){ ?>
	      <blockquote><?php print_r($this->data["lastmod"]); ?></blockquote>
		<?php } ?>
	  </div>
	</div>
  </div>
</div>
<hr data-am-widget="divider" style="" class="am-divider am-divider-default" />
<!-- 底部 -->
<footer data-am-widget="footer" class="am-g am-footer am-footer-default" data-am-footer="{  }">
  <div class="am-u-sm-11 am-u-md-11 am-u-lg-10 footer-inner">
  <div class="footer-inner-left am-u-sm-11 am-u-md-11 am-u-lg-10">  
    <div class="am-footer-switch">
      <span class="am-footer-ysp" data-rel="mobile"
          data-am-modal="{target: '#am-switch-mode'}">
          手机版(暂未推出)
      </span>
      <span class="am-footer-divider"> | </span>
      <a id="godesktop" data-rel="desktop" class="am-footer-desktop" href="javascript:">
          电脑版
      </a>
<!--
      <span class="am-footer-divider"> | </span>
      <span class="am-footer-ysp" data-rel="mobile"
          data-am-modal="{target: '#am-switch-mode'}">
          命令行版(暂未推出)
      </span>
-->
    </div>
	<div>
	  <?php echo "我的中国梦 · 简洁 · 现代 · 自由 / 为Linux用户的娱乐性而奋斗！"; ?>
	</div>	
    <div class="footer-copyright">
	  <?php echo $this->data["copyright"]; ?>	  
	</div>
    <div class="am-footer-miscs ">
	  <p>Powered by Mediawiki and theme designed by 小鸡. </p>
      <p>CopyRight©2012-<?php echo date("Y"); ?>  gamux.org.</p>
	</div>
  </div>  
  <div class="am-u-lg-2">
	<div class="copyrightico"><?php echo $this->data["copyrightico"]; ?></div>
	<div class="poweredbyico"><?php echo $this->data["poweredbyico"]; ?></div>
<!--
	<div class="footer-qq"><button type="button" class="am-btn am-btn-primary">Q群274328087</button></div>
-->
  </div>
  </div>
  <div data-am-widget="gotop" class="am-gotop am-gotop-fixed" >
    <a href="#top" title="回到顶部">
        <span class="am-gotop-title">回到顶部</span>
          <i class="am-gotop-icon am-icon-chevron-up"></i>
    </a>
  </div>
</footer>
</div>
<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.4.2/css/amazeui.min.css">
<script src="http://cdn.amazeui.org/amazeui/2.4.2/js/amazeui.min.js"></script>
<?php if(!$this->data["isarticle"]) { ?>
<link rel="stylesheet" href="<?php echo "http://".$_SERVER['HTTP_HOST']."/skins/Gamux"; ?>/css/specialpages.css">
<script src="<?php echo "http://".$_SERVER['HTTP_HOST']."/skins/Gamux"; ?>/resources/specialpages.js"></script>
<?php } ?>
<script>
$(".successbox").delay(1000).hide(0);
</script>
<?php $this->printTrail(); ?>	
</body>
</html><?php
	}
}